// import chineseToPinYin from '@/lib/pinyin'
import axios from 'axios'
// import {devServer} from "../../../../vue.config";
axios.defaults.baseURL = '/api'

/**
 * 搜索表单设置
 * @rules:  是否验证       {Boolean}
 * @inline: 是否内联       {Boolean}
 * @width:  label宽度     {String}
 * @align:  label对齐方式  {String}
 */
const searchFormSetting = {
    rules: false,
    inline: true,
    ref: 'searchForm',
    width: '70px',
    align: 'right'
}
const searchFormGroup= [
      ]
/**
 * 搜索表单按钮事件
 * @name: 按钮名称
 * @event: 按钮事件名（子组件直接@eventName=handleCustomizeEvent）
 * @primary：按钮类型（按钮的颜色）
 * @icon：按钮的小图标
 */
const searchFormButton = [
    {name: '查询', event: 'search', type: 'primary', icon: 'el-icon-search'},
    {name: '重置', event: 'reset', type: 'info', icon: 'el-icon-refresh-left'},
    // {name: '一键导出', event: 'export',type:'success', icon: 'el-icon-download'},
    {name: '上传文件', event: 'upload', type: 'success', icon: 'el-icon-upload'},
    {name: '添加记录', event: 'create', type: 'warning', icon: 'el-icon-plus'},
    {name: '删除选中', event: 'delete', type: 'danger', icon: 'el-icon-delete'}
]


/**
 * 表格表头信息
 * @chineseToPinYin: 这是封装的根据中文汉字转换为拼音的方法
 * @prop: 表头字段名
 * @filter: 数据过滤器
 * @label: 表头显示名称
 */

const tableTitle = [
    {prop: 'customer_hospital', label: '客户单位', width: '140'},
    {prop: 'clinical_department', label: '临床科室', width: '140'},
    {prop: 'surgical_type', label: '手术类型', width: '120'},
    {prop: 'doctor', label: '主刀医生', width: '100'},
    {prop: 'product_model', label: '产品型号', width: '100'},
    {prop: 'equipment_number', label: '设备编号', width: '100'},
    {prop: 'system_version', label: '软件版本', width: '160'},
    {prop: 'nature', label: '项目性质', width: '120'},
    {prop: 'occurred_time', label: '手术时间', width: '140'},
    {prop: 'created_at', label: '导入系统时间', width: '140'},
    {prop: 'updated_at', label: '最后修改时间', width: '140'}
]
/**
 * 表格按钮事件
 * @event: 按钮事件名（子组件直接@eventName=handleCustomizeEvent）
 * @primary：按钮类型（按钮的颜色）
 */
const tableButton = [
    {label: '编辑', event: 'edit', type: 'primary'},
    {label: '删除', event: 'delete', type: 'danger'}
]

/**
 * 弹出层表单
 */
const dialogFormSetting = {
    rules: false,
    inline: false,
    ref: 'dialogForm',
    width: '90px',
    align: 'left'
}

const dialogFormGroup = [
    {label: '客户单位', type: 'input', required: true},
    {label: '临床科室', type: 'input', required: true},
    {label: '手术类型', type: 'input', required: true},
    {label: '主刀医生', type: 'input', required: true},
    {label: '产品型号', type: 'input', required: true},
    {label: '设备编号', type: 'input', required: true},
    {label: '软件版本', type: 'input', required: true},
    {label: '项目性质', type: 'input', required: true},
    {label: '手术时间', type: 'date', required: true}
]

const dialogFormButton = [
    {name: '确定', event: 'create', type: 'primary'},
    {name: '取消', event: 'cancel'}
]

const uploadFormSetting = {
    rules: false,
    inline: false,
    ref: 'uploadForm',
    width: '90px',
    align: 'left'
}

const uploadFormGroup = [
    {label: '产品型号', type: 'select', required: true},
    {
        label: '手术上传',
        type: 'upload-drag',
        action: '/api/feedback/surgical/upload/',
        limit: 1,
        tip: '请上手术安排的.xlsx/.xlsm格式文件',
        required: true
    }
]

const uploadFormButton = [
    {name: '确定', event: 'upload', type: 'primary'},
    {name: '取消', event: 'cancel'}
]

export {
    searchFormSetting,
    searchFormButton,
    tableTitle,
    tableButton,
    searchFormGroup,
    dialogFormButton,
    dialogFormGroup,
    dialogFormSetting,
    uploadFormGroup,
    uploadFormButton,
    uploadFormSetting
}
